<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>李昊哲-小课</title>
    <style>
        div{
            font-size: 100px;
        }
    </style>
</head>

<body>
    <!-- 传统方式渲染DOM元素 -->
    <div id="box"></div>
    <script>
        // 1、获取页面DOM元素
        let box = window.document.querySelector('#box');
        // 2、准备渲染内容
        let slogan = '桃李不言下自成蹊';
        // 3、渲染页面DOM元素
        box.innerText = slogan;
        let html = `slogan = ${slogan}`;
        // 事件监听
        box.addEventListener('click',function (e) {
            e.preventDefault();
            window.alert(box.innerText);
        });
    </script>

    <!-- vue方式渲染DOM -->
    <!-- 引入vue.js文件 -->
    <script src="../js/vue.js"></script>
    <!-- 准被渲染的DOM -->
    <div id="app">{{ message }}</div>

    <script>
        // const { createApp } = Vue
        let app ={
            data() {
                return {
                    message: 'Hello Vue!'
                }
            }
        };
        // 创建vue实例
        Vue.createApp(app).mount('#app')
    </script>

</body>

</html>